<?php if (!defined('THINK_PATH')) exit(); /*a:1:{s:88:"D:\phpStudy\PHPTutorial\WWW\dk.eatchickengame.com/application/index\view\user\index.html";i:1529028144;}*/ ?>
<!DOCTYPE html>
<html lang="zh-cn">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <title>
    </title>
    <meta name="format-detection" content="telephone=no, address=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-touch-fullscreen" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
    <script type="text/javascript" src="__FRONT__/js/jquery-1.11.1.min.js"></script>
    <script type="text/javascript" src="__FRONT__/js/mui.min.js"></script>
    <script type="text/javascript" src="__FRONT__/js/common.js"></script>
    <link href="__FRONT__/css/bootstrap.min.css" rel="stylesheet">
    <link href="__FRONT__/css/common.min.css" rel="stylesheet">

</head>
<body class="mui-ios mui-ios-11 mui-ios-11-0">
<div class="container container-fill">
    <script>
        $(function () {
            $(document).on('click', '.login-code', function () {
                var username = $('input[name="username"]').val();
                var password = $('input[name="password"]').val();
                if (!username || !password) {
                    showmsg('用户名或密码为空', 1);
                    return;
                }

                var myreg = /^(((13[0-9]{1})|(15[0-9]{1})|(18[0-9]{1}))+\d{8})$/;
                if (!myreg.test(username)) {
                    showmsg('请输入正确的手机号码', 1);
                    return false;
                }
                if (password.length < 6) {
                    showmsg('密码不能小于六位数', 1);
                    return;
                }


                $.post("<?php echo url('user/checkLogin'); ?>",{'username': username, 'password': password},function(data){
                    if (data.code==1) {
                        showmsg(data.msg,1);
                    } else {
                        showmsg(data.msg,0,"<?php echo url('user/index'); ?>");
                    }
                })
            })
           /* $(document).on('click', '.send-code', function () {
                var username = $(' input[name="username"]').val();
                option = {
                    'btnElement': $('.send-code'),
                    'showElement': $('.js-timer'),
                    'btnTips': '<a class="send-code">重新获取验证码</a>',
                    'successCallback': function (ret, message) {
                        if (ret == '0') {
                            util.toast(message);
                            $('.js-sendcode').hide();
                            $('.js-codeverify').show();
                        } else {
                            util.toast(message);
                            $('.js-sendcode').show();
                            $('.js-codeverify').hide();
                            return;
                        }
                    }
                };
                util.sendCode(username, option);
            });*/
        });
    </script>
    <div class="mui-content mc-login">
        <div class="avatar mui-text-center">
            <img src="__FRONT__/img/headimg_1.jpg" class="mui-img-circle">
        </div>
        <form action=""
              method="post" enctype="multipart/form-data" class="js-ajax-form">
            <div class="mui-control-content mui-active" id="login-basic">
                <div class="mui-input-group">
                    <div class="mui-input-row">
                        <label class="mui-label-icon"><i class="fa fa-user"></i></label>
                        <input name="username" type="text" placeholder="手机号">
                    </div>
                    <div class="mui-input-row mui-help">
                        <label class="mui-label-icon"><i class="fa fa-lock"></i></label>
                        <input name="password" type="password" placeholder="密码">
                        <div class="mui-help-info mui-text-right"><a
                                href="<?php echo url('user/repwd'); ?>">忘记密码</a>
                        </div>
                    </div>
                </div>
            </div>
            <div class="mui-content-padded">
                <button class="mui-btn mui-btn-success mui-btn-block login-basic btn_login login-code" type="button" name="submit" value="提交">登录
                </button>
            </div>
        </form>
        <div class="mui-content-padded">
            <div class="mui-text-center mui-mt15">
                <a href="<?php echo url('user/reg'); ?>">注册账号</a>
                <span class="mui-ml5 mui-mr5 mui-text-muted"></span>
                <!--<a href="">无密码登录</a>-->
            </div>
        </div>
    </div>
</div>

<!--
<div class="mui-toast-container mui-active"><div class="mui-toast-message"><div class="mui-toast-icon"><span class="fa fa-exclamation-circle"></span></div>用户名或密码为空</div></div>
-->
<div class="msg-box"></div>

</body>
</html>